# -*- encoding: utf-8 -*-
"""
由sheinparse.py生成shein数据解析规则
@ver     :   1.1.1
@File    :   genparserules.py    
@Time    :   2021-02-04 21:30
"""
from random import choices
import base64

with open("sheinparse.py", "r", encoding="utf-8") as f:
    content = f.read()

enStr = base64.encodebytes(content.encode("utf-8"))
refDict = "0123456789"
refDict += "".join([chr(x) for x in range(65, 91)])
refDict += "".join([chr(x) for x in range(97, 123)])
refKey = ''.join(choices(refDict, k=5))
refKey = refKey.encode("utf-8")

with open("parserules.data", "wb") as f:
    f.write(refKey+enStr)
